/* eslint valid-jsdoc: "off" */

'use strict'

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = (appInfo) => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = (exports = {})

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + '_1654564306349_742'

  // add your middleware config here
  config.middleware = []

  config.security = {
    // post 类接口
    csrf: {
      // enable: false,
      headerName: 'x-csrf-token',
    },
  }

  config.cors = {
    origin: '*',
  }

  // 解析上传图片
  config.multipart = {
    mode: 'file',
  }

  config.oss = {
    client: {
      accessKeyId: 'LTAI5tD4g2wcz8pNJpY4ZALQ',
      accessKeySecret: 'gwYopnM5kfEEmhvj4E3GRDaPj4EyEv',
      bucket: '1911a-devin0712',
      endpoint: 'oss-cn-shanghai.aliyuncs.com',
      timeout: '60s',
    },
  }

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  }

  return {
    ...config,
    ...userConfig,
  }
}
